<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="(item, key, index) in list">
                {{item}} -- {{key}} --{{index}}
            </li>
        </ul>
        <ul>
            <!-- in或of遍历阿拉伯数字 -->
            <!-- <li v-for="n in 10"> -->
            <li v-for="(n,index) of 10">
                {{n}}---{{index}}
            </li>
        </ul>
        <div id="box">
            <ul>
                <li v-for="item in listHasKey" :key="item.id">
                    <span>{{item.goodName}}</span>|
                    <span>{{item.price}}</span>|
                    <span v-if="item.stats === 0">未付款</span>
                    <span v-else-if="item.stats === 1">已下单</span>
                    <span v-else-if="item.stats === 2">已发货</span>
                </li>
            </ul>
        </div>
    </div>
    <script src='./js/vue.js'></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                list: {
                    name: 'zs',
                    age: 12,
                    sex: {
                        x: 1,
                        y: 2
                    }
                },
                listHasKey: [
                    {
                        id: 001,
                        goodName: "手机1",
                        price: "3000",
                        stats: 0//未付款
                    },
                    {
                        id: 002,
                        goodName: "手机2",
                        price: "4000",
                        stats: 1//已下单
                    },
                    {
                        id: 003,
                        goodName: "手机3",
                        price: "5000",
                        stats: 2//已发货
                    },

                ]
            }
        })
    </script>
</body>

</html>